import i18n from '../../lang';
export default function modalIcon(callback) {
  const h = this.$createElement;
  return new Promise((resolve, reject) => {
    this.$msgbox({
      title: i18n.t('caiDanTuBiao'),
      customClass: 'upload-form',
      closeOnClickModal: true,
      showClose: true,
      message: h('div', { class: 'common-form-upload' }, [
        h('iconFrom', {
          on: {
            getIcon(n) {
              callback(n);
            },
          },
        }),
      ]),
      showCancelButton: false,
      showConfirmButton: false,
    })
      .then(() => {
        resolve();
      })
      .catch(() => {
        reject();
        this.$message({
          type: 'info',
          message: i18n.t('yiQuXiao'),
        });
      });
  });
}
